import pandas as pd


#简单的转换工具，将抓取的csv数据，转换成txt数据
dfr = pd.read_csv('spiders/job_data.csv', encoding='utf-8')
print(dfr.head(1))
#values = dfr.values.tolist()
file = open('spiders/csv_txt.txt', 'w', encoding='utf-8')
file.write('title#job_city#salary_min#salary_max#\
        experience_year#ducation_need#publish_date#\
        job_advantage_tags#position_info#url\n')
for item in dfr.values:
    file.write(
        item[0] + '#' + item[1] + '#' + str(item[2]) + '#' + str(item[3]) + '#' +
        item[4] + '#' + item[5] + '#' + item[6] + '#' +
        item[7] + '#' + item[8] + '#' + item[9] + '\n')